package State 
{
	import com.citrusengine.core.CitrusEngine;
	import com.citrusengine.core.State;
	import flash.display.Sprite;
	import flash.events.*;
	/**
	 * ...
	 * @author Haxx
	 */
	public class MainMenuState extends State
	{
		//--------------------------------
		// Assets
		//--------------------------------
		
		[Embed(source="../../bin/mainmenu.swf", symbol="main_menu")]
		private var cMainMenu:Class;
		private var sMainMenu:Sprite;
		
		//--------------------------------
		// Symbol Instance Names
		//--------------------------------
		
		private var BTN_PLAY:String = "playBtn";
		
		public function MainMenuState() 
		{
			super();
		}
		
		override public function initialize():void 
		{
			super.initialize();
			
			sMainMenu = new cMainMenu();
			addChild(sMainMenu);
			
			sMainMenu[BTN_PLAY].addEventListener(MouseEvent.CLICK, startGame);
		}
		
		private function startGame(e:MouseEvent):void
		{
			sMainMenu[BTN_PLAY].removeEventListener(MouseEvent.CLICK, startGame);
			this.stage.focus = this.stage;
			
			CitrusEngine.getInstance().state = new State.InstructionsState();
		}
		
	}

}